const express = require("express");
const router = express.Router();
const axios = require("axios");
let baseUrl = "http://localhost:5008/api/atm";

router.post("/getATM", async (req, res, next) => {
  const { data } = await axios.post(`${baseUrl}/getATM`, {}, {
    params: {
      areaId: req.body.areaId
    },
    headers: req.headers
  }
  );

  // console.log("result from server: ", data);
  res.send(data);
  next();
});

module.exports = router;